<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8">
<title>文章添加</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link
	href="http://ueditor.baidu.com/umeditor/themes/default/css/umeditor.min.css"
	type="text/css" rel="stylesheet">
<link rel="stylesheet" href="./css/x-admin.css" media="all">

    <script src="js/jquery1.42.min.js"></script>
</head>
<body>
<script type="text/javascript">
function returnto(){
	location.href="index.jsp";
}
</script>
<script type="text/javascript">

	$(document).ready(function(){
		$.ajax({
			type : "GET",
			dataType : "json",
			url : "getCinemaByManageId.do",
	       success : function(msg) {
	    	   
	       	//定义数组名
	     	if(msg.flag==1){
	     		
	     	  	let content = msg.msgcontent;
		       	
		       	let str="";
		       	for (let i = 0; i < content.length; i++) {
		       		
					str=str+'<option value="'+content[i].cinema_name+'">'+content[i].cinema_name+'</option>';
					
				}
		       	$("#ccname").html(str);
	     	}
	       
	       	
	       }
		});	
		


	});
	
</script>
	<div class="x-nav">
		<span class="layui-breadcrumb"> <a><cite>首页</cite></a> <a><cite>发表信息管理</cite></a>
			<a><cite>添加发表信息</cite></a>
		</span> <a class="layui-btn layui-btn-small"
			style="line-height: 1.6em; margin-top: 3px; float: right"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="layui-icon" style="line-height: 30px">ဂ</i></a>
	</div>
	<div class="x-body">
		<form class="layui-form layui-form-pane" action="addPublic.do" method="get">
			<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
				<!-- <ul class="layui-tab-title">
                <li class="layui-this">基本信息</li>
                <li>状态信息</li>
                <li>文章内容</li>
            </ul> -->

				<div class="layui-tab-content">
					<div class="layui-tab-item layui-show">

						<input type="hidden" name="flag" value="addPublic">
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>影院名称
							</label>
							<div class="layui-input-block" >
								<select id="ccname" name="cname">
								
								
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>影院地区
							</label>
							<div class="layui-input-block">
								<input type="text" name="place" autocomplete="off"
									placeholder="请输入影院地区" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>电影名字
							</label>
							<div class="layui-input-block">
								<input type="text" name="moviename" autocomplete="off"
									placeholder="请输入电影名称" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>放映时间
							</label>
							<div class="layui-input-block">
								<input type="text" name="time" autocomplete="off"
									placeholder="请输入放映时间" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>放映日期
							</label>
							<div class="layui-input-block">
								<input type="text" name="date" autocomplete="off"
									placeholder="请输入放映日期" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>电影语言类型
							</label>
							<div class="layui-input-block">
								<input type="text" name="language" autocomplete="off"
									placeholder="请输入语言类型" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>电影票价格
							</label>
							<div class="layui-input-block">
								<input type="text" name="price" autocomplete="off"
									placeholder="请输入价格" class="layui-input">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>影厅号码
							</label>
							
								<div class="layui-input-block">
								<input type="text" name="movieaddress" autocomplete="off"
									placeholder="请输入影厅号码" class="layui-input">
							</div>
							
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>影院地址
							</label>
							<div class="layui-input-block">
								<input type="text" name="address" autocomplete="off"
									placeholder="请输入影院地址" class="layui-input">
							</div>
						</div>
					
						<div class="layui-form-item">
							<input class="layui-btn" type="submit" lay-filter="add"
								value="添加发布信息">
								 <input class="layui-btn" type="button" value="返回" onclick="javascript:returnto()">
						</div>
						</form>
						
						<div style="height: 100px;"></div>
					</div>
					<div class="layui-tab-item">
						<!--  <form class="layui-form layui-form-pane" action="" id="add">-->
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>状态
							</label>
							<div class="layui-input-block">
								<input type="radio" name="status" value="1" title="显示" checked>
								<div class="layui-unselect layui-form-radio layui-form-radioed">
									<i class="layui-anim layui-icon layui-anim-scaleSpring"></i>
									<div>显示</div>
								</div>
								<input type="radio" name="status" value="0" title="隐藏">
								<div class="layui-unselect layui-form-radio">
									<i class="layui-anim layui-icon"></i>
									<div>隐藏</div>
								</div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>是否置顶
							</label>
							<div class="layui-input-block">
								<input type="radio" name="istop" value="1" title="显示" checked>
								<div class="layui-unselect layui-form-radio layui-form-radioed">
									<i class="layui-anim layui-icon layui-anim-scaleSpring"></i>
									<div>置顶</div>
								</div>
								<input type="radio" name="istop" value="0" title="隐藏">
								<div class="layui-unselect layui-form-radio">
									<i class="layui-anim layui-icon"></i>
									<div>不置顶</div>
								</div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>是否推荐
							</label>
							<div class="layui-input-block">
								<input type="radio" name="isrecommand" value="1" title="显示"
									checked>
								<div class="layui-unselect layui-form-radio layui-form-radioed">
									<i class="layui-anim layui-icon layui-anim-scaleSpring"></i>
									<div>推荐</div>
								</div>
								<input type="radio" name="isrecommand" value="0" title="隐藏">
								<div class="layui-unselect layui-form-radio">
									<i class="layui-anim layui-icon"></i>
									<div>不推荐</div>
								</div>
							</div>
						</div>

						<div class="layui-form-item layui-form-text">
							<label class="layui-form-label"> <span class='x-red'>*</span>文章简介
							</label>
							<div class="layui-input-block">
								<textarea placeholder="请输入内容" name="abstract"
									class="layui-textarea">{$art.abstract}</textarea>
							</div>
						</div>

						<div class="layui-form-item">
							<button class="layui-btn" type="button" lay-filter="add"
								lay-submit="">保存</button>
						</div>
						<!--</form>-->
					</div>
					<div class="layui-tab-item">
						<!-- <form class="layui-form layui-form-pane" action="" id="add">-->
						<div class="layui-form-item">
							<label for="link" class="layui-form-label"> <span
								class="x-red">*</span>文章内容
							</label>
							<div class="layui-input-inline">
								<textarea id="content" placeholder="" name="content"></textarea>
							</div>
						</div>

						<div class="layui-form-item">
							<button class="layui-btn" type="button" lay-filter="add"
								lay-submit="">保存</button>
						</div>
						<!--</form>-->
					</div>

				</div>

			</div>
		</form>
	</div>
	<script src="./lib/layui/layui.js" charset="utf-8"></script>
	<script src="./js/x-layui.js" charset="utf-8"></script>
	<script type="text/javascript">
		//实例化编辑器
		//建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
		/* UE.getEditor('content', {
			initialFrameWidth : 600,
			initialFrameHeight : 400,
		}); */
	</script>
	<script>
		/* layui.use([ 'element', 'layer', 'form' ], function() {
			$ = layui.jquery;//jquery
			lement = layui.element();//面包导航
			layer = layui.layer;//弹出层
			form = layui.form();
 */
			//图片上传接口
			/*layui.upload({
			  url: './upload.json' //上传接口
			  ,success: function(res){ //上传成功后的回调
			      console.log(res);
			    $('#LAY_demo_upload').attr('src',res.url);
			  }
			});*/

			<!-- //监听提交
			/* form.on('submit(add)', function(data) {
				var title = $("input[name='title']").val();
				//var content=$("textarea[name='content']").val();

				var article_category_id = $(
						'#article_category_id option:selected').val();//所属文章类型
				//alert(title);
				//var form=$("#cate_add").serialize();
				if (title == "") {
					layer.msg('文章标题不能为空', {
						icon : 5,
						time : 2000
					});
					return false;
				}
				if (article_category_id == "") {
					layer.msg('文章类型不能为空', {
						icon : 5,
						time : 2000
					});
					return false;
				}
				/*if(content){
				    layer.msg("文章内容不能为空！",{icon:5,time:2000});return false;
				}
				var data = data.field;
				$.ajax({
					type : "post",
					url : "",
					data : data,
					dataType : "json",
					success : function(data) {
						if (data.status == 1) {
							layer.msg(data.info, {
								icon : 6,
								time : 2000
							}, function() {
								window.parent.location.reload();
								var index = parent.layer
										.getFrameIndex(window.name);
								parent.layer.close(index);
							});
							return false;

						} else {
							layer.msg(data.info, {
								icon : 5,
								time : 2000
							});
							return false;
						}
					}

				});

			});

		}) */
	</script>

	<!-- <script>
		function upload(obj, id) {
			var formData = new FormData();
			formData.append('images', $('#previewImg')[0].files[0]);
			formData.append('id', id);//将id追加再id中
			layer.msg('图片上传中', {
				icon : 16
			});
			$.ajax({
				type : "post",
				processData : false,
				contentType : false,
				url : "",
				data : formData,
				success : function(data) {
					if (data.status == 1) {
						console.log(data.image_name);
						layer.closeAll('loading');
						//layer.msg(data.info,{icon:1,time:1000});
						$("#pimages").attr('src', data.image_name);
						$("#avatar").val(data.image_name);
						$(".imgs").show();
						return false;
					} else {
						layer.msg(data.info, {
							icon : 2,
							time : 1000
						});
					}
				}
			});
		} -->
	</script>

</body>
</html>